<?php

class Nuo_Session_Abstract
{
	/**
	 * default lifetime is one hour
	 * @var int
	 */
	protected $_lifetime = 3600;

	/**
	 * @var string
	 */
	protected $_path = '';

	/**
	 * @var string
	 */
	protected $_name = '';

	/**
	 * @param bool
	 */
	protected $_exsists = FALSE;

	/**
	 * @param int $value
	 * @return Session_Engine
	 */
	public function setLifetime($value)
	{
		$this -> _lifetime = intval($value);
		return $this;
	}

	/**
	 * Retrieve session lifetime
	 *
	 * @return int
	 */
	public function getLifetime()
	{
		if (null == $this -> _lifetime)
		{
			return 86400;
		}
		return $this -> _lifetime;
	}

	/**
	 * Open Session
	 *
	 * @param string $save_path
	 * @param string $name
	 * @return TRUE
	 */
	public function open($path, $name)
	{
		$this -> _path = $path;
		$this -> _name = $name;
		return TRUE;
	}

	/**
	 * Close session
	 * @return TRUE
	 */
	public function close()
	{
		return TRUE;
	}

	/**
	 * Read session data
	 *
	 * @param string $id
	 * @return string
	 */
	public function read($id)
	{
		return '';
	}

	/**
	 * Write session data
	 *
	 * @param string $id
	 * @param string $data
	 * @return TRUE
	 */
	public function write($id, $data)
	{
		return TRUE;
	}

	/**
	 * Destroy session
	 *
	 * @param string $id
	 * @return TRUE
	 */
	public function destroy($id)
	{
		return TRUE;
	}

	/**
	 * Garbage Collection
	 *
	 * @param int $maxlifetime
	 * @return TRUE
	 */
	public function gc($maxlifetime)
	{
		return TRUE;
	}

}
